# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-blinkstick
pkgver=1.2.0
pkgrel=4
_commit="60bd10528fe6ecabfdaef4c5343864e98de19263" # Git repo isn't tagged, but this is equivalent to 1.2.0 on PyPi
pkgdesc="Python interface to control BlinkStick devices connected to the computer"
url="https://www.blinkstick.com/"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-usb
	python3
	"
makedepends="py3-setuptools"
subpackages="blinkstick $pkgname-pyc"
# https://pypi.python.org/packages/source/B/BlinkStick/BlinkStick-$pkgver.tar.gz
source="https://github.com/arvydas/blinkstick-python/archive/$_commit/blinkstick-python-$_commit.tar.gz
	0001-python3-env.patch
	0002-Changed-dependency-on-pyusb-to-accept-anything-higher-than-1.0.0.patch
	85-blinkstick.rules
	"
options="!check" # No tests
builddir="$srcdir/blinkstick-python-$_commit"

build() {
	python3 setup.py build
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"

	install -Dm644 "$srcdir"/85-blinkstick.rules -t "$pkgdir"/usr/share/udev/rules.d
}

blinkstick() {
	depends="$pkgname"

	amove usr/bin
}

sha512sums="
422f5fd640f7a6d5672f78b495b6798818e74f8828588a6c3ca3586ba17c57c7862a5481d4d5f7052761b3c50865c40894cdb2c771c62e849c9cb2c921b5ce32  blinkstick-python-60bd10528fe6ecabfdaef4c5343864e98de19263.tar.gz
01c9c9236db85158eeaea66aad760feb4d2b478625929ce484e42da377f81c3de9dc481e6cd586a2e3cb774c18d2513cd11263063353a6cc6500a53a2e55f977  0001-python3-env.patch
930c68107e1d97746a483b4b525dee9d0201da7dbf8176f0defd7c3bda7d8dd05f7ea6b8a80e9393d877fa7a926b37594876d492d926991f3f4ac53c1c6ba219  0002-Changed-dependency-on-pyusb-to-accept-anything-higher-than-1.0.0.patch
e63b007e8e6baa2f20c9adde1471a7e0e09f075178347d913858667fd58ec4af51c42120c142f8fe76f12c3207375e437a788e23fd576f17eb01f691b63ebc1c  85-blinkstick.rules
"
